<?php /*a:2:{s:89:"E:\xiaopi\phpstudy_pro\WWW\zhengmaotong\public/themes/admin_default/admin\user\index.html";i:1695775678;s:86:"E:\xiaopi\phpstudy_pro\WWW\zhengmaotong\public/themes/admin_default/public\header.html";i:1695775678;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->

    <link href="/themes/admin_default/public/assets/themes/<?php echo cmf_get_admin_style('arcoadmin'); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="/themes/admin_default/public/assets/simpleboot/css/simplebootadmin.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/themes/admin_default/public/assets/themes/<?php echo cmf_get_admin_style('arcoadmin'); ?>/simplebootadmin.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <?php 
        $is_mobile=cmf_is_mobile();
        $_static_version='1.0.5';
        $cmf_version=cmf_version();
        if (preg_match("/^(8|6)\./",$cmf_version)) {
        $_app=app()->http->getName();
        }else{
        $_app=request()->module();
        }
     ?>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            API_ROOT: {api: '/api/'},
            APP: '<?php echo $_app; ?>'/*当前应用名*/,
            IS_MOBILE: <?php echo !empty($is_mobile) ? 'true'  :  'false'; ?>
        };
    </script>
    <script src="/themes/admin_default/public/assets/js/jquery-1.12.4.min.js"></script>
    <script src="/themes/admin_default/public/assets/js/jquery-migrate-1.4.1.min.js"></script>
    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_default/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.alias({noty: '/themes/admin_default/public/assets/js/noty-2.4.1.js'})
    </script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container: 'body',
                html: true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>

</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="<?php echo url('User/index'); ?>"><?php echo lang('ADMIN_USER_INDEX'); ?></a></li>
        <li><a href="<?php echo url('User/add'); ?>"><?php echo lang('ADMIN_USER_ADD'); ?></a></li>
    </ul>
    <form class="well form-inline margin-top-20 bg-white" method="get" action="<?php echo url('User/index'); ?>">
        用户名:
        <input type="text" class="form-control" name="user_login" style="width: 120px;"
               value="<?php echo input('request.user_login/s',''); ?>" placeholder="请输入<?php echo lang('USERNAME'); ?>">
        邮箱:
        <input type="text" class="form-control" name="user_email" style="width: 120px;"
               value="<?php echo input('request.user_email/s',''); ?>" placeholder="请输入<?php echo lang('EMAIL'); ?>">
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="<?php echo url('User/index'); ?>">清空</a>
    </form>
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
            <th width="50">ID</th>
            <th><?php echo lang('USERNAME'); ?></th>
            <th><?php echo lang('LAST_LOGIN_IP'); ?></th>
            <th><?php echo lang('LAST_LOGIN_TIME'); ?></th>
            <th><?php echo lang('EMAIL'); ?></th>
            <th><?php echo lang('STATUS'); ?></th>
            <th width="120"><?php echo lang('ACTIONS'); ?></th>
        </tr>
        </thead>
        <tbody>
        <?php 
            $user_statuses=array("0"=>lang('USER_STATUS_BLOCKED'),"1"=>lang('USER_STATUS_ACTIVATED'),"2"=>lang('USER_STATUS_UNVERIFIED'));
         if(is_array($users) || $users instanceof \think\Collection || $users instanceof \think\Paginator): if( count($users)==0 ) : echo "" ;else: foreach($users as $key=>$vo): ?>
            <tr>
                <td><?php echo $vo['id']; ?></td>
                <td>
                    <?php if($vo['user_url']): ?><a href="<?php echo $vo['user_url']; ?>" target="_blank" title="<?php echo $vo['signature']; ?>"><?php echo $vo['user_login']; ?></a>
                        <?php else: ?>
                        <?php echo $vo['user_login']; ?>
                    <?php endif; ?>
                </td>
                <td><?php echo $vo['last_login_ip']; ?></td>
                <td>
                    <?php if($vo['last_login_time'] == 0): ?>
                        <?php echo lang('USER_HAVE_NOT_LOGIN'); else: ?>
                        <?php echo date('Y-m-d H:i:s',$vo['last_login_time']); ?>
                    <?php endif; ?>
                </td>
                <td><?php echo $vo['user_email']; ?></td>
                <td>
                    <?php switch($vo['user_status']): case "0": ?>
                            <span class="label label-danger"><?php echo $user_statuses[$vo['user_status']]; ?></span>
                        <?php break; case "1": ?>
                            <span class="label label-success"><?php echo $user_statuses[$vo['user_status']]; ?></span>
                        <?php break; case "2": ?>
                            <span class="label label-warning"><?php echo $user_statuses[$vo['user_status']]; ?></span>
                        <?php break; ?>
                    <?php endswitch; ?>
                </td>
                <td>
                    <?php if($vo['id'] == 1 || $vo['id'] == cmf_get_current_admin_id()): if($vo['user_status'] == 1): ?>
                            <span class="btn btn-xs btn-warning disabled"
                                  title="<?php echo lang('BLOCK_USER'); ?>"
                                  data-toggle="tooltip">
                                <i class="fa fa-toggle-off fa-fw"></i>
                            </span>
                            <?php else: ?>
                            <span class="btn btn-xs btn-warning disabled"
                                  title="<?php echo lang('ACTIVATE_USER'); ?>"
                                  data-toggle="tooltip">
                                <i class="fa fa-toggle-on fa-fw"></i>
                            </span>
                        <?php endif; ?>
                        <span class="btn btn-xs btn-primary disabled" title="<?php echo lang('EDIT'); ?>" data-toggle="tooltip">
                            <i class="fa fa-edit fa-fw"></i></span>
                        <span class="btn btn-xs btn-danger disabled" title="<?php echo lang('DELETE'); ?>" data-toggle="tooltip">
                            <i class="fa fa-trash fa-fw"></i></span>
                        <?php else: if($vo['user_status'] == 1): ?>
                            <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
                               href="javascript:"
                               data-href="admin/users/<?php echo $vo['id']; ?>/status/0"
                               data-msg="<?php echo lang('BLOCK_USER_CONFIRM_MESSAGE'); ?>"
                               title="<?php echo lang('BLOCK_USER'); ?>" data-toggle="tooltip">
                                <i class="fa fa-toggle-off fa-fw"></i>
                            </a>
                            <?php else: ?>
                            <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                               href="javascript:"
                               data-href="admin/users/<?php echo $vo['id']; ?>/status/1"
                               data-msg="<?php echo lang('ACTIVATE_USER_CONFIRM_MESSAGE'); ?>"
                               title="<?php echo lang('ACTIVATE_USER'); ?>" data-toggle="tooltip">
                                <i class="fa fa-toggle-on fa-fw"></i>
                            </a>
                        <?php endif; ?>
                        <a class="btn btn-xs btn-primary" href='<?php echo url("User/edit",array("id"=>$vo["id"])); ?>'
                           title="<?php echo lang('EDIT'); ?>" data-toggle="tooltip">
                            <i class="fa fa-edit fa-fw"></i>
                        </a>
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="javascript:"
                           data-href="admin/users/<?php echo $vo['id']; ?>" title="<?php echo lang('DELETE'); ?>" data-toggle="tooltip">
                            <i class="fa fa-trash fa-fw"></i>
                        </a>
                    <?php endif; ?>
                </td>
            </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    <div class="pagination"><?php echo $page; ?></div>
</div>
<script src="/static/js/admin.js?v=<?php echo $_static_version; ?>"></script>
</body>
</html>
